﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net.Mail;

/// <summary>
/// Summary description for EmailHelper
/// </summary>
public static class EmailHelper
{
    public static void SendEmailToAdmin(string EmailId, string Subject, string Comment)
    {
        MailMessage message = new MailMessage();
        message.From = new MailAddress("ali.umar@arwatech.com");
        message.To.Add(EmailId);
        message.Subject = "Thanks to show your interest.";
        message.Body = "Soon our staff member will contect with you.<br/> You have sent the following details.<br/><br/>" + "Subject: " + Comment + "<br/><br/>" + Comment;
        //sc.Port = 587;
        //sc.EnableSsl = true;
        SendEmail(message);
    }

    public static void SendConfermationEmailToUser(string EmailId, string Subject, string Comment)
    {
        MailMessage message = new MailMessage();
        message.From = new MailAddress(EmailId);
        message.To.Add("ali.umar@arwatech.com");
        message.Subject = Subject;
        message.Body = Comment;
        SendEmail(message);
    }

    public static void SendEmail(MailMessage message)
    {
        message.IsBodyHtml = true;
        SmtpClient sc = new SmtpClient();
        sc.Host = "mail.arwatech.in";
        sc.Credentials = new System.Net.NetworkCredential("ali.umar@arwatech.com", "Arwatech@1947");
        sc.Send(message);
    }
}